/*--------------------------------------------------------------
 * File: demo53.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 使用引用循环替换数值
 * a\b\c三个变量，通过引用按顺序循环替换他们的值
 * Version 0.1
 * Date 2022-08-15 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

void Swap(int *a, int *b, int *c)
{
    int temp = 0;
    temp = *b;
    *b = *a;
    *a = *c;
    *c = temp;
}

int main(int argc, char const *argv[])
{
    int a,b,c;

    printf("输入a,b,c的值：");
    scanf("%d %d %d",&a,&b,&c);

    printf("交换前：a=%d,b=%d,c=%d\n",a,b,c);
    Swap(&a, &b, &c);
    printf("交换后：a=%d,b=%d,c=%d\n",a,b,c);
    
    return 0;
}
